/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.edu.ifal.softhouse.bd;

import br.edu.ifal.softhouse.modelo.FabricaConexao;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

/**
 *
 * @author Carmelita SBO
 */
public class LoginBD {
    public boolean efetualogin(String nome, String senha) throws SQLException{
        
        FabricaConexao fc = new FabricaConexao();
        Connection con = fc.getConnection();
        String sql = "select *  from login where usuario=?, senha=?";
        PreparedStatement stmt = con.prepareStatement(sql);
        stmt.setString(1, nome);
        stmt.setString(2, senha);
        ResultSet rs = stmt.executeQuery();
        
        while (rs.next()) {
            return true;
        }
        return false;
    }
    
}
